package mysql

import "jwgin/service"

// 签到活动规则
type ActivitySignRule struct {
	Sid      int `gorm:"sid" json:"sid"`
	RuleBean int `gorm:"rule_bean" json:"rule_bean"` // 创建活动的公司

}

func (ActivitySignRule) TableName() string {
	return "activity_sign_rule"
}

type ActivitySignRecord struct {
	Id         int `gorm:"id" json:"id"`
	ActivityId int `gorm:"activity_id" json:"activity_id"`
	Uid        int `gorm:"uid" json:"uid"`
	Jw
	Bean int `gorm:"bean" json:"bean"` // 获的金豆
}

func (ActivitySignRecord) TableName() string {
	return "activity_sign_record"
}

//用户打卡
func (s *ActivitySignRecord) UserAdd() error {
	return service.G.Create(s).Error
}

//用户打卡列表
func (s *ActivitySignRecord) UserList() (resp []map[string]interface{}) {
	service.G.Where(s).Scan(&resp)
	return
}
